<?php include TPLPATH . 'header.html'; ?>
<div class="box">
    <table>
        <tbody>
            <tr>
                <th style="width: 35px;">ID</th>
                <th style="width: 100px;">姓名</th>
                <th style="width: 130px;">邮箱</th>
                <th style="width: 45px;">性别</th>
                <th style="width: 100px;">角色</th>
                <th style="width: 75px;">登录次数</th>
                <th style="width: 100px;">最后IP</th>
                <th style="width: 100px;">最后访问</th>
                <th style="width: 100px;">操作</th>
            </tr>
            <?php
            if (!empty($list)) {
                $i = 0;
                foreach ($list as $val) {
            ?>
            <tr<?php if(++$i%2){ ?> class="highlight"<?php } ?>>
                <td><?php echo $val['id']; ?></td>
                <td><a title="<?php echo $val['name']; ?>" href="<?php echo jaUrl('user', 'edit', 'id='.$val['id']); ?>"><span style="color:<?php echo $val['color']; ?>"><?php echo $val['name']; ?></span></a></td>
                <td><?php echo $val['email']; ?></td>
                <td><?php echo $val['gender']; ?></td>
                <td><?php echo $val['role_name']; ?></td>
                <td><?php echo $val['login_count']; ?></td>
                <td><?php echo $val['last_ip']; ?></td>
                <td><?php echo $val['last_visit']; ?></td>
                <td class="action">
                    <ul>
                        <li><a title="edit" href="<?php echo jaUrl('user', 'edit', 'id='.$val['id']); ?>" class="edit"></a></li>
                        <li><a title="delete" href="javascript:;" onclick="if(confirm('确定删除？'))window.location.href='<?php echo jaUrl('user', 'dodelete', 'id='.$val['id']); ?>';" class="delete"></a></li>
                        <?php if ($val['status']==2) { ?>
                        <li><a title="unlock" href="<?php echo jaUrl('user', 'dolock', 'status=1&id='.$val['id']); ?>" class="unlock"></a></li>
                        <?php } elseif ($val['status']==1) { ?>
                        <li><a title="lock" href="<?php echo jaUrl('user', 'dolock', 'status=2&id='.$val['id']); ?>" class="lock"></a></li>
                        <?php } ?>
                        <?php if ($val['status']==0) { ?>
                        <li><a title="激活" href="<?php echo jaUrl('user', 'doactive', 'id='.$val['id']); ?>" class="mark"></a></li>
                        <?php } ?>
                    </ul>
                </td>
            </tr>
            <?php
                }
            }
            ?>
        </tbody>
    </table>
    <p id="pagin">
        <?php echo $showPages; ?>
    </p>
</div>
<?php include TPLPATH . 'footer.html'; ?>
